#include <stdio.h>
#include <string.h>

int main() {
    char str[10005], board[10005];
    gets(str);
    gets(board);

    int len1 = strlen(str);
    int len2 = strlen(board);

    int i, j, isSame;
    for (i = 0; i < len1; i++) 
    {
        isSame = 0;
        for (j = 0; j < len2; j++) 
        {
            if (str[i] == board[j]) 
            {
                isSame = 1;
                break;
            }
        }
        if (!isSame) 
        {
            printf("%c", str[i]);
        }
    }

    return 0;
}

